#---------------------------------------------------------------------------------------------------------------
#    Yig - A network music instrument for constructing feedback matrices synchronized with OSC using OSCthulhu
#    Chad McKinney, 2011
#
#    Licensed under GNU GPL 3.0
#    See COPYING for licensing details
#---------------------------------------------------------------------------------------------------------------

QT     += core gui opengl
TARGET = Yig

###########################################################################################################################
# libsc++ vars. CHANGE THESE TO THE CORRECT PATHS AND VERSIONS
###########################################################################################################################

LIBSCPP_SOURCE = /Users/curtismckinney/Documents/C++Dev/SC++
# Currently these should be from SC version 3.5.0
SUPERCOLLIDER_SOURCE = /Users/curtismckinney/Documents/SuperColliderSource/SuperCollider-Source-3.5
LIBSCSYNTH = /Users/curtismckinney/Documents/SuperColliderSource/SuperCollider-Source-3.5/build/server/scsynth/Release
LIBSCLANG = /Users/curtismckinney/Documents/SuperColliderSource/SuperCollider-Source-3.5/build/lang/Release
# Currently this MUST be boost 1.49
BOOST = /usr/local/boost_1_49_0

# Change to your OS version (and make sure its there!)
QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.6.sdk

# currently 64bit. If you want i386 you will need to build above libraries yourself for i386 first
CONFIG += x86_64

# Bugfix hack for Qt 4.7+ and Boost 1.48+ BOOST_JOIN bug
QT_INSTALL_BINS = /Users/curtismckinney/QtSDK/Desktop/Qt/4.8.0/gcc/bin
QMAKE_MOC = $${QT_INSTALL_BINS}/moc -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED

###########################################################################################################################

mac {
    CONFIG += app_bundle
    ICON = graphics/Yig.icns
    SYNTH_DEFS.files = sc++/synthdefs
    SYNTH_DEFS.path = Contents/MacOS
    QMAKE_BUNDLE_DATA += SYNTH_DEFS
    PLUGINS.files = sc++/plugins
    PLUGINS.path = Contents/MacOS
    QMAKE_BUNDLE_DATA += PLUGINS
    QMAKE_INFO_PLIST = YigInfo.plist
}

win32 {
    CONFIG += console
}

CONFIG += opengl

TEMPLATE = app

#QMAKE_CFLAGS += -DSC_AUDIO_API=SC_AUDIO_API_AUDIOUNITS
QMAKE_CFLAGS += -D__MACOSX_CORE__
#-lpthread
#QMAKE_CXXFLAGS += -DSC_AUDIO_API=SC_AUDIO_API_AUDIOUNITS
QMAKE_CXXFLAGS += -D__MACOSX_CORE__
CXXFLAGS += -D__MACOSX_CORE__
CXXFLAGS +=-DSC_DARWIN
LIBS += -lpthread

LIBS += -framework CoreAudio
LIBS += -framework CoreServices
LIBS += -framework vecLib
LIBS += -framework CoreFoundation

QMAKE_LFLAGS += -F/System/Library/Frameworks/CoreFoundation.Framework

INCLUDEPATH += oscpack/
DEPENDPATH += oscpack/

SOURCES += main.cpp \
    yig.cpp \
    gui/yiggraphicsview.cpp \
    gui/yigmainwindow.cpp \
    interface/channel/yignetworkchannel.cpp \
    interface/yigsynth.cpp \
    graphics/yigsynthgraphic.cpp \
    gui/yignetworkchannelview.cpp \
    gui/yigsynthmenu.cpp \
    gui/yigsynthbutton.cpp \
    graphics/yigcablegraphic.cpp \
    graphics/yigbasegraphic.cpp \
    oscpack/osc/OscOutboundPacketStream.cpp \
    oscpack/osc/OscPrintReceivedElements.cpp \
    oscpack/osc/OscReceivedElements.cpp \
    oscpack/osc/OscTypes.cpp \
    oscpack/ip/IpEndpointName.cpp \
    oscpack/ip/posix/UdpSocket.cpp \
    oscpack/ip/posix/NetworkingUtils.cpp \
    network/yigpacketlistener.cpp \
    network/yigclient.cpp \
    graphics/yigcolorkit.cpp \
    gui/yiggraphicsscene.cpp \
 #   sc++/server.cpp \
    sc++/sclang.cpp \
 #   sc++/synth.cpp \
    sc++/bus.cpp \
    interface/yigcable.cpp \
#    sc++/group.cpp \
#    sc++/node.cpp \
    gui/yigchat.cpp \
    gui/yigloginmenu.cpp \
    graphics/yigattractor.cpp \
    gui/yigscsynthbootmenu.cpp \
#    sc++/libscsynth/SCProcess.cpp \
#    sc++/libscsynth/OSCMessages.cpp \
#    sc++/libscsynth/embeddedSC.cpp \
#    sc++/libscsynth/scsynthprocess.cpp \
#    rtaudio/RtAudio.cpp \
#    graphics/yigglwidget.cpp \
    graphics/yigcursor.cpp \
    gui/yigscore.cpp \
    gui/yigclock.cpp


HEADERS += \
    yig.h \
    gui/yiggraphicsview.h \
    gui/yigmainwindow.h \
    interface/channel/yignetworkchannel.h \
    interface/yigsynth.h \
    graphics/yigsynthgraphic.h \
    gui/yignetworkchannelview.h \
    gui/yigsynthmenu.h \
    gui/yigsynthbutton.h \
    graphics/yigcablegraphic.h \
    graphics/yigbasegraphic.h \
    oscpack/osc/OscException.h \
    oscpack/osc/OscHostEndianness.h \
    oscpack/osc/OscOutboundPacketStream.h \
    oscpack/osc/OscPacketListener.h \
    oscpack/osc/OscPrintReceivedElements.h \
    oscpack/osc/OscReceivedElements.h \
    oscpack/osc/OscTypes.h \
    oscpack/ip/UdpSocket.h \
    oscpack/ip/TimerListener.h \
    oscpack/ip/PacketListener.h \
    oscpack/ip/NetworkingUtils.h \
    oscpack/ip/IpEndpointName.h \
    network/yigpacketlistener.h \
    network/yigclient.h \
    graphics/yigcolorkit.h \
    gui/yiggraphicsscene.h \
 #   sc++/server.h \
    sc++/sclang.h \
 #   sc++/synth.h \
    sc++/bus.h \
    interface/yigcable.h \
 #   sc++/group.h \
#    sc++/node.h \
    gui/yigchat.h \
    gui/yigloginmenu.h \
    graphics/yigattractor.h \
    gui/yigscsynthbootmenu.h \
#    sc++/libscsynth/SCProcess.h \
#    sc++/libscsynth/OSCMessages.h \
#    sc++/libscsynth/embeddedSC.h \
#    sc++/libscsynth/scsynthprocess.h \
#    rtaudio/RtError.h \
#    rtaudio/RtAudio.h \
#    graphics/yigglwidget.h \
    graphics/yigcursor.h \
    gui/yigscore.h \
    gui/yigclock.h

RESOURCES += \
    YigResources.qrc

OTHER_FILES += \
    sc++/synthdefs/YigSine.scsyndef \
    sc++/synthdefs/YigCable.scsyndef \
    sc++/synthdefs/CavernPuggle.scsyndef \
    sc++/synthdefs/Cardamom Bonbon.scsyndef \
    sc++/synthdefs/BubbleGuts.scsyndef \
    gui/yig-loader.gif

#LIBS += sc++/libscsynth/libscsynthAU.a
#PRE_TARGETDEPS += sc++/libscsynth/libscsynthAU.a

#libSC++
LIBS += $${LIBSCPP_SOURCE}/build/release/libSC++.a
PRE_TARGETDEPS += $${LIBSCPP_SOURCE}/build/release/libSC++.a

#libscsynth.dylib
LIBS += $${LIBSCSYNTH}/libscsynth.dylib
PRE_TARGETDEPS += $${LIBSCSYNTH}/libscsynth.dylib

#libsclang.a
LIBS += $${LIBSCLANG}/libsclang.a
PRE_TARGETDEPS += $${LIBSCLANG}/libsclang.a

INCLUDEPATH += $${BOOST} \
    $${LIBSCPP_SOURCE} \
    $${SUPERCOLLIDER_SOURCE}/include/common \
    $${SUPERCOLLIDER_SOURCE}/include/plugin_interface \
    $${SUPERCOLLIDER_SOURCE}/include/server \
    $${SUPERCOLLIDER_SOURCE}/include/lang \
    $${SUPERCOLLIDER_SOURCE}/external_libraries \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost/libs/date_time/src/gregorian \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost/libs/date_time/src/posix_time \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost_endian \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost_lockfree \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/curl \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/icu \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/libsndfile \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/nova-simd \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/nova-tt \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/oscpack \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/pycxx-6.22 \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/simplejson-2.3.2 \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/threadpool \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/TLSF-2.4.6/src \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/yaml-cpp-0.3.0

DEPENDPATH += $${BOOST} \
    $${LIBSCPP_SOURCE} \
    $${SUPERCOLLIDER_SOURCE}/include/common \
    $${SUPERCOLLIDER_SOURCE}/include/plugin_interface \
    $${SUPERCOLLIDER_SOURCE}/include/server \
    $${SUPERCOLLIDER_SOURCE}/include/lang \
    $${SUPERCOLLIDER_SOURCE}/external_libraries \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost/libs/date_time/src/gregorian \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost/libs/date_time/src/posix_time \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost_endian \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/boost_lockfree \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/curl \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/icu \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/libsndfile \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/nova-simd \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/nova-tt \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/oscpack \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/pycxx-6.22 \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/simplejson-2.3.2 \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/threadpool \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/TLSF-2.4.6/src \
    $${SUPERCOLLIDER_SOURCE}/external_libraries/yaml-cpp-0.3.0

#INCLUDEPATH += sc++/libscsynth/include/common \
#    sc++/libscsynth/include/plugin_interface \
#    sc++/libscsynth/include/server \

#DEPENDPATH += sc++/libscsynth/include/common \
#    sc++/libscsynth/include/plugin_interface \
#    sc++/libscsynth/include/server \








